package com.cxyzy.aopdemo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

public class FirstActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_first);
        findViewById(R.id.gotoSecondPageButton).setOnClickListener(this);
        findViewById(R.id.clearLoginButton).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.gotoSecondPageButton:
                LoginIntercept.startActivity(FirstActivity.this, new Intent(FirstActivity.this, SecondActivity.class), LoginActivity.class);
                break;
            case R.id.clearLoginButton:
                Constant.isLogged = false;
                break;
            default:
                break;
        }

    }
}
